<?

function renderNavBar($page){
  $addEventMsg = ( User::isAutentified() )?"Añade una protesta":"Avisa de una protesta";
  
?>
    <div class="navbar navbar-inverse" id="main-navbar">
      <div class="navbar-inner">
        <div class="container-fluid">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="index.php"><img id="logo" src="images/logo.png" width="30" height="30" />Manifiestate.net</a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              <a href="<?echo ($page=="main")?"#modal_add":"index.php?task=modal_add"; ?>" class="btn btn-small btn-success" data-toggle="modal"><i class="icon-plus-sign icon-white"></i><?echo $addEventMsg?></a>
              <?php if( User::isAutentified() ) { ?>
                <a href="./admin/index.php" class="btn btn-small btn-warning"><i class="icon-user icon-white"></i>Administración</a>
                <a href="index.php?task=logout" class="btn btn-small btn-danger"><i class="icon-off icon-white"></i>Salir</a>
              <?php } else { ?>
                <a href="login.php" class="btn btn-small btn-warning"><i class="icon-off icon-white"></i>Entrar</a>
              <?php } ?>
            </p>
            <ul class="nav">
              <li><a href="index.php">Inicio</a></li>
              <li><a href="<? echo ($page=="main")?"#info":"index.php#info";?>">Info</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

<?
}
?>
